package com.example.fresheveryday.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.fresheveryday.po.Comment;
import com.example.fresheveryday.mapper.CommentMapper;
import com.example.fresheveryday.po.Product;
import com.example.fresheveryday.service.CommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ll
 * @since 2023-07-08
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    public int countByConditions(@Param("ew") Wrapper wrapper){
        return commentMapper.countByConditions(wrapper);
    }
    public IPage<Comment> getCommentByConditions(IPage<Comment> page, @Param("ew") Wrapper wrapper){
        return  commentMapper.getCommentByConditions(page,wrapper);
    }

    @Override
    public IPage<Comment> getAllComment(IPage<Comment> page) {
        return commentMapper.getAllComment(page);
    }
////    public List<Comment> getAllComment(){
////        return commentMapper.getAllComment();
//    }
}
